home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 326-350 / disk_337 / cmanual / windows.lzh / Windows / Example5.c < prev    next >
C/C++ Source or Header  |  1990-01-30  |  3KB  |  88 lines

  1. /* Example5                                                             */
  2. /* This program will open a Borderless window which is connected to the */
  3. /* Workbench Screen. It will display it for 30 seconds, and then quit.  */
  4.  
  5.  
  6.  
  7. /* If your program is using Intuition you should include intuition.h: */
  8. #include <intuition/intuition.h>
  9.  
  10.  
  11.  
  12. struct IntuitionBase *IntuitionBase;
  13.  
  14.  
  15.  
  16. /* Declare a pointer to a Window structure: */ 
  17. struct Window *my_window;
  18.  
  19. /* Declare and initialize your NewWindow structure: */
  20. struct NewWindow my_new_window=
  21. {
  22.   50,            /* LeftEdge    x position of the window. */
  23.   25,            /* TopEdge     y positio of the window. */
  24.   200,           /* Width       200 pixels wide. */
  25.   100,           /* Height      100 lines high. */
  26.   0,             /* DetailPen   Text should be drawn with colour reg. 0 */
  27.   1,             /* BlockPen    Blocks should be drawn with colour reg. 1 */
  28.   NULL,          /* IDCMPFlags  No IDCMP flags. */
  29.   SMART_REFRESH| /* Flags       Intuition should refresh the window. */
  30.   BORDERLESS|    /*             No borders. */
  31.   ACTIVATE,      /*             The window should be Active when opened. */
  32.   NULL,          /* FirstGadget No Custom Gadgets. */
  33.   NULL,          /* CheckMark   Use Intuition's default CheckMark (v). */
  34.   "MY WINDOW",   /* Title       Title of the window. */
  35.   NULL,          /* Screen      Connected to the Workbench Screen. */
  36.   NULL,          /* BitMap      No Custom BitMap. */
  37.   0,             /* MinWidth    We do not need to care about these */
  38.   0,             /* MinHeight   since we havent supplied the window with */
  39.   0,             /* MaxWidth    a Sizing Gadget. */
  40.   0,             /* MaxHeight */
  41.   WBENCHSCREEN   /* Type        Connected to the Workbench Screen. */
  42. };
  43.  
  44.  
  45.  
  46. main()
  47. {
  48.   /* Open the Intuition Library: */
  49.   IntuitionBase = (struct IntuitionBase *)
  50.     OpenLibrary( "intuition.library", 0 );
  51.   
  52.   if( IntuitionBase == NULL )
  53.     exit(); /* Could NOT open the Intuition Library! */
  54.  
  55.  
  56.  
  57.   /* We will now try to open the window: */
  58.   my_window = (struct Window *) OpenWindow( &my_new_window );
  59.   
  60.   /* Have we opened the window succesfully? */
  61.   if(my_window == NULL)
  62.   {
  63.     /* Could NOT open the Window! */
  64.     
  65.     /* Close the Intuition Library since we have opened it: */
  66.     CloseLibrary( IntuitionBase );
  67.  
  68.     exit();  
  69.   }
  70.  
  71.  
  72.  
  73.   /* We have opened the window, and everything seems to be OK. */
  74.   /* Wait for 30 seconds: */
  75.   Delay( 50 * 30);
  76.  
  77.  
  78.  
  79.   /* We should always close the windows we have opened before we leave: */
  80.   CloseWindow( my_window );
  81.  
  82.  
  83.   
  84.   /* Close the Intuition Library since we have opened it: */
  85.   CloseLibrary( IntuitionBase );
  86.   
  87.   /* THE END */
  88. }